import store from 'store'

export class UserStore {
  /** session.userID */
  public id: string = store.get('userid') || 'zxh'

  public get isAdmin() {
    return this.id === 'admin'
  }

  public setId(userID: string) {
    this.id = userID
    store.set('userid', userID)
  }

  public setIdNoStore(userID: string) {
    this.id = userID
  }
}

export default new UserStore()
